﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Light.Utility;

namespace Test
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void btnResize_Click(object sender, EventArgs e)
        {
            pictureBox2.Image = ImageProcessor.Resize(
                pictureBox1.Image,
                StringHelper.ToInt(txtWidth.Text),
                StringHelper.ToInt(txtHeight.Text), true);
        }

        private void btnAddWater_Click(object sender, EventArgs e)
        {
            pictureBox2.Image = ImageProcessor.AddWaterMark(
                 pictureBox2.Image,
                 txtWords.Text,
                 new Font(new FontFamily(txtFontFamily.Text), StringHelper.ToInt(txtFontSize.Text)),
                 Color.FromName(txtColor.Text),
                 StringHelper.ToInt(txtWidth.Text),
                 StringHelper.ToInt(txtHeight.Text),
                 float.Parse(txtAngel.Text)
                 );
        }

        private void btnCombine_Click(object sender, EventArgs e)
        {
            pictureBox1.Image = ImageProcessor.Combine(
                 pictureBox1.Image,
                 pictureBox2.Image,
                 StringHelper.ToInt(txtWidth.Text),
                 StringHelper.ToInt(txtHeight.Text)
                 );
        }
    }
}
